package eu.irreality.dai.ui.wrapper;

import java.awt.Graphics;

import javax.swing.JPanel;

/**
 * Pane that incorporates a Display to handle the painting process.
 * 
 */
public class DisplayPanel extends JPanel
{

    private Display display;

    /**
     * Creates a panel that is painted by a Display.
     * 
     * @param display
     *            Display to handle the painting process.
     */
    public DisplayPanel(Display display)
    {
	super();
	this.display = display;
    }

    @Override
    protected void paintComponent(Graphics g)
    {
	super.paintComponent(g);
	display.setPixelSize(this.getHeight(), this.getWidth());
	display.refresh(g);
    }

}
